﻿#include"head.h"

#define PATHNAME "./help.txt"
#define HELPSIZE 2
void HelpDocument()
{
	int fd_op1;
	int ret=0;
	if(access(PATHNAME,F_OK))
	{
		fd_op1 = open(PATHNAME,O_RDWR|O_CREAT,0644);
	}else{
		fd_op1 = open(PATHNAME,O_RDWR,0644);
	}
	char buf[HELPSIZE];
	while(1)
	{
		bzero(buf,HELPSIZE);
		ret = read(fd_op1,buf,HELPSIZE+1);
		if(ret<0)
		{
			break;
		}else if(ret == 0){
			printf("It has been finished\n\n");
			break;
		}else{
			printf("%s",buf);
		}
			
	}

}